package DispatchSys;

/**
 * Structure holding an assignment information
 * 
 */
public class Assignment {
	
	// Emergency
	private ERInfo er;
	
	// Ambulance assigned to the emergency
	private AmbulanceInfo am;
	
	// Assignment finished ?
	private boolean finished;
    	
	/**
	 * Creates the Assignment
	 * @param er : emergency assigned
	 * @param am : ambulance assigned to er
	 */
	public Assignment(ERInfo er, AmbulanceInfo am) {
		super();
		this.er = er;
		this.am = am;
		this.finished = false;
	}

	/**
	 * 
	 * @return the emergency corresponding to the assignment
	 */
	public ERInfo getEr() {
		return er;
	}
	
    /**
     * 
     * @return the ambulance corresponding to the assignment
     */
	public AmbulanceInfo getAm() {
		return am;
	}

	/**
	 * Checks if the assignment is finished, i.e mission
	 * finished
	 * @return true if finished, false otherwise
	 */
	public boolean isFinished() {
		return finished;
	}

	/**
	 * Finish the assignment
	 */
	public void setFinished() {
		this.finished = true;
	}	
	
	
}
